var vm = new Vue({
  el : '#app',
  extends: CommonTools,
  
  data : function(){
    return {
    conditions: {
        leClass:'',
        leName:'',
      },
      pageData: {
        page: 1,
        rows: 10,
        total: 0,
        results: []
      },
      currentRow: null,
      gStudent:{},
    }
  },
  
  filters: {

	    /**
	     * 状态名称
	     */
	    stateName(state) {
	     if(state=="unpass"){
	     	return "已拒绝"
	     }else{
	    	 return "已通过"
	     }
	    },
	    
	  },
  methods: {  
    
    /**
     * 重新加载
     */
    reload(page, pageSize){
    	  var self = this;
	      page = page? page: this.pageData.page;
	      pageSize = pageSize? pageSize: this.pageData.rows;
	      
	      var url = "../../gLeaveController.do?datagrid3&page=" 
        + page + "&rows=" + pageSize;
	      if (self.conditions.leName){
	        url += "&leName=" + self.conditions.leName;
	      }
	      if (self.conditions.leClass){
	    	  url += "&leClass=" + self.conditions.leClass;
	      }
	      this.get(url).then(data => {       
	          self.pageData = data;        
	        }).catch(err => {
	          self.showError(err);
	        });
    },
    onQuery(){
    	this.reload();
    }
    

  },
  
  created() {
    this.reload();
  },
  
});